import time

from selenium import webdriver
from selenium.webdriver.chrome.service import Service
from selenium.webdriver.common.by import By

# 1.创建驱动对象
service = Service("C:/Program Files/Google/Chrome/Application/chromedriver.exe")
driver = webdriver.Chrome(service=service)

# 2.打开浏览器
driver.get("file:///C:/Users/82073/Desktop/pagetest/%E6%B3%A8%E5%86%8CA.html")

# 3.操作
# driver.find_element(By.CSS_SELECTOR, "#userA").send_keys("admin")
# driver.find_element(By.CSS_SELECTOR, "button").click()
# driver.find_element(By.CSS_SELECTOR, "[type='password']").send_keys("123456")
# driver.find_element(By.CSS_SELECTOR, "p[id='pa']>input").send_keys("123456")
# driver.find_element(By.CSS_SELECTOR, "div[class='zc'] input").send_keys("123456")
driver.find_element(By.CSS_SELECTOR, "input[type^='p']").send_keys("123456")
driver.find_element(By.CSS_SELECTOR, "input[class$='gin']").send_keys("123456")
driver.find_element(By.CSS_SELECTOR, "input[name*='ema']").send_keys("123456")

# 4.3s后关闭
time.sleep(3)

# 5.关闭驱动对象
driver.close()